<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateExternalTransfersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('external_transfers', function (Blueprint $table) {
            $table->id();
            $table->string('department')->default('')->comment('所属门店');
            $table->string('customer_name')->default('')->comment('顾客名字');
            $table->string('company_name')->default('')->comment('调配公司');
            $table->timestamp('start_date')->nullable()->comment('开始时间');
            $table->timestamp('end_date')->nullable()->comment('结束时间');
            $table->string('category')->default('')->comment('车类型');
            $table->string('plate_number')->default('')->comment('车牌号');
            $table->decimal('transfer_price',10,2)->default(0.00)->comment('调配金额');
            $table->decimal('lease_price',10,2)->default(0.00)->comment('出租金额');
            $table->string('order_sn',)->default('')->comment('订单号');

            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `external_transfers` comment '外调车'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('external_transfers');
    }
}
